from flask import Flask,render_template,url_for,request

app=Flask(__name__)


@app.route('/')
def index():
    return '欢迎欢淫欢淫'


@app.route('/setting')
def seting():
    seting_css=url_for('static',filename='css/seting.css')
    seting_js=url_for('static',filename='js/mian.js')
    return render_template('setting.html', seting_css=seting_css, seting_js=seting_js)

@app.route('/setting-req',methods=['GET', 'POST'])
def setting_req():
    date=request.data
    ls=date.decode('utf-8')
    ll=ls[1:len(ls)-1]
    lb=eval(ll)
    from contrl.setting_contrl import setting_constr
    new_setting=setting_constr
    result=new_setting.insert_setting_contrl(lb)
    if result == None:
        return "保存成功！"
    else:
        return result



if __name__ == '__main__':
    app.run()

